<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增资产')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-asset-add">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">资产名称：</label>
				<div class="col-sm-8">
					<input id="assetName" name="assetName" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">资产编号：</label>
				<div class="col-sm-8">
					<input id="assetNo" name="assetNo" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">资产数量：</label>
				<div class="col-sm-8">
					<input id="num" name="num" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">数量单位：</label>
				<div class="col-sm-8">
					<select name="numUnit" class="form-control m-b" th:with="type=${@dict.getType('oa_asset_num_unit')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">资产单价：</label>
				<div class="col-sm-8">
					<input id="price" name="price" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">保管年限：</label>
				<div class="col-sm-8">
					<input id="storageTime" name="storageTime" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">资产类型：</label>
				<div class="col-sm-8">
					<select name="assetType" class="form-control m-b" th:with="type=${@dict.getType('oa_asset_type')}">
	                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
	                </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">入库时间：</label>
				<div class="col-sm-8">
					<input type="text" class="time-input" id="addTime" placeholder="入库时间" name="addTime" required/>
				</div>
			</div>
		</form>
	</div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "oa/asset";
		$("#form-asset-add").validate({
            rules:{
                dictSort:{
                    digits:true
                },
            },
            focusCleanup: true

        });

		function submitHandler() {
	        if ($.validate.form()) {
				$.operate.save(prefix + "/add", $('#form-asset-add').serialize());
	        }
	    }
	</script>
</body>
</html>
